/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.edu.pe.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author DANIEL
 */
@Entity
@Table(name = "SAU_COORDINADOR_EAP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SauCoordinadorEap.findAll", query = "SELECT s FROM SauCoordinadorEap s"),
    @NamedQuery(name = "SauCoordinadorEap.findByIdCoordinadorEap", query = "SELECT s FROM SauCoordinadorEap s WHERE s.idCoordinadorEap = :idCoordinadorEap")})
public class SauCoordinadorEap implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_COORDINADOR_EAP")
    private BigDecimal idCoordinadorEap;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCoordinadorEap")
    private Collection<SauEapFacultad> sauEapFacultadCollection;
    @JoinColumn(name = "ID_PERSONA", referencedColumnName = "ID_PERSONA")
    @ManyToOne(optional = false)
    private SauPersona idPersona;

    public SauCoordinadorEap() {
    }

    public SauCoordinadorEap(BigDecimal idCoordinadorEap) {
        this.idCoordinadorEap = idCoordinadorEap;
    }

    public BigDecimal getIdCoordinadorEap() {
        return idCoordinadorEap;
    }

    public void setIdCoordinadorEap(BigDecimal idCoordinadorEap) {
        this.idCoordinadorEap = idCoordinadorEap;
    }

    @XmlTransient
    public Collection<SauEapFacultad> getSauEapFacultadCollection() {
        return sauEapFacultadCollection;
    }

    public void setSauEapFacultadCollection(Collection<SauEapFacultad> sauEapFacultadCollection) {
        this.sauEapFacultadCollection = sauEapFacultadCollection;
    }

    public SauPersona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(SauPersona idPersona) {
        this.idPersona = idPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCoordinadorEap != null ? idCoordinadorEap.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SauCoordinadorEap)) {
            return false;
        }
        SauCoordinadorEap other = (SauCoordinadorEap) object;
        if ((this.idCoordinadorEap == null && other.idCoordinadorEap != null) || (this.idCoordinadorEap != null && !this.idCoordinadorEap.equals(other.idCoordinadorEap))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upeu.edu.pe.model.SauCoordinadorEap[ idCoordinadorEap=" + idCoordinadorEap + " ]";
    }
    
}
